<{include file="top.html" }>
</head>
<body>
<div class="xy-panel">
    <div class="xy-panel-top">
        <div class="xy-titlebar">
            <div class="xy-titlebar-left">
                <a class="insertBefore_left_arrow_gray" href="javascript:void(0);"></a>
            </div>
            <div class="xy-titlebar-title">帐号登录</div>
            <div class="xy-titlebar-right"></div>
        </div>
    </div>
    <div class="xy-panel-content" style="bottom:0;">
        <div class="xy-row vDirectionRow">
            <form class="form-box">
                <dl><input id="tel" type="tel" placeholder="请输入手机号"></dl>
                <dl><input id="password" type="password" placeholder="请输入登录密码"></dl>
            </form>
            <div class="ui-button ui-button-2" style="padding-bottom:0;">
                <button id="sign">登 录</button>
            </div>
            <div class="" style="padding:0 1rem; line-height:5rem;">
                <!--<a href="../#">微信一键登录</a>-->
                <a href="<{U("User/reg")}>">快速注册</a>
                <a href="<{U("User/forget")}>" style="float:right;">忘记密码</a>
            </div>
            <!--<div class="register-button">
                <a href="<{U("User/reg")}>">快速注册</a>
            </div>-->
        </div>
    </div>
</div>


</body>
</html>
<script src="<{$preStaticUrl}>Wap/js/flexible.js"></script>
<script>
    var loginUrl= "<{U('User/signIn')}>";
    var flag = 0;
    var url = "<{$url}>";

    $(function(){

        $('#sign').click(function(){
            var phone = $('#tel').val()
                ,password = $('#password').val();
            if (!validatePhone(phone)) {
                layer.msg('请填写正确的手机号码');
                return false;
            }
            if(password.length < 6 || password.length > 32){
                layer.msg("密码格式不正确！支持6-32字节");
                return false;
            }
            var param = {phone:phone,password:password};
            $ajax(loginUrl, param, function (data, func) {
                if(data.status){
                    layer.msg(data.msg);
                }else{
                    if(data.ext){
                        layer.msg("登录成功，+"+data.ext['pointChange']+"积分");
                    }
                    if(url) window.location.href = url;
                    else window.history.go(-1);
                }
                if(func) func();
            });
        });


    });


</script>